package cn.itsource.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document("tb_article")
public class Article {
    @Id
    private String _id;

    private Long id;
    private String articlePic;
    private String articleName;
    private String articleTag;
    private Long articleType;
    private Integer articleState;
    private Integer topState = 0;
    private Long publishId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime = new Date();

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    private Integer articleReadCount = 0;
    private Integer articleStarNum = 0;
    private Integer articleCommentNum = 0;
    private String articleRemark;
    private String articleContent;

    //自动映射其他表的数据
    private String publishName; //作者名称
    private String articleTypeName;  //文章类型


    private ArticleType tbarticleType; //多对一
    private User tbuser;

    //归档板块：
    private String year;//年份
    private String month; //月份
    private String day; //日期
}



